home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / gemfsc19 / gemfsc19.lzh / GNUGEM27 / VDICTRL2.C < prev    next >
C/C++ Source or Header  |  1993-03-24  |  2KB  |  101 lines

  1. /*
  2.  *    Vdi contrl functions library interface (part 2)
  3.  *
  4.  *    v_clrwk      clear workstation
  5.  *    v_updwk      update workstation
  6.  *    vst_load_fonts     load fonts
  7.  *    vst_unload_fonts unload fonts
  8.  *    vs_clip      set clipping rect
  9.  *
  10.  *        ++jrb    bammi@cadence.com
  11.  *        modified: mj -- ntomczak@vm.ucs.ualberta.ca
  12.  */
  13. #include "common.h"
  14.  
  15. #ifdef __DEF_ALL__
  16.  
  17. #define L_v_clrwk
  18. #define L_v_updwk
  19. #define L_vst_load
  20. #define L_vst_unlo
  21. #define L_vs_clip
  22.  
  23. #endif /* __DEF_ALL__ */
  24.  
  25.  
  26. #ifdef L_v_clrwk
  27.  
  28. /* clear workstation
  29.  *    returns void
  30.  */
  31. void v_clrwk(int handle)
  32. {
  33.     __vdi__(VDI_CONTRL_ENCODE(3, 0, 0, 0), handle);
  34. }
  35. #endif /* L_v_clrwk */
  36.  
  37. #ifdef L_v_updwk
  38.  
  39. /* update workstation
  40.  *    returns void
  41.  */
  42. void v_updwk(int handle)
  43. {
  44.     __vdi__(VDI_CONTRL_ENCODE(4, 0, 0, 0), handle);
  45. }
  46. #endif /* L_v_updwk */
  47.  
  48. #ifdef L_vst_load
  49.  
  50. /* load fonts as per assign.sys (atari -- when will you fix this brain death??)
  51.  *    returns # of additional font id's
  52.  */
  53. int vst_load_fonts(int handle, int select)
  54. {
  55.     _intin[0] = select;
  56.     __vdi__(VDI_CONTRL_ENCODE(119, 0, 1, 0), handle);
  57.  
  58.     return (int)_intout[0];
  59. }
  60. #endif /* L_vst_load */
  61.  
  62. #ifdef L_vst_unlo
  63.  
  64. /* unload fonts (what a joke -- atari please fix)
  65.  *    returns void
  66.  */
  67. void vst_unload_fonts(int handle, int select)
  68. {
  69.     _intin[0] = select;
  70.     __vdi__(VDI_CONTRL_ENCODE(120, 0, 1, 0), handle);
  71. }
  72. #endif /* L_vst_unlo */
  73.  
  74. #ifdef L_vs_clip
  75.  
  76. /* set clip rect
  77.  *    returns void
  78.  */
  79. void vs_clip(int handle, int clip_flag, int pxyarray[])
  80. {
  81. #ifdef __MSHORT__        /* we have 16 bit ints, just change vdi params */
  82.     _vdiparams[2] = (void *) &pxyarray[0];
  83. #else                    /* 32 bit ints - let's copy */
  84.     register int i;
  85.  
  86.     for(i = 0; i < 4; i++)
  87.     _ptsin[i] = pxyarray[i];
  88. #endif
  89.  
  90.     _intin[0] = clip_flag;
  91.  
  92.     __vdi__(VDI_CONTRL_ENCODE(129, 2, 1, 0), handle);
  93.  
  94. #ifdef __MSHORT__
  95.     _vdiparams[2] = (void *)&_ptsin[0]; /* restore vdi parameters */
  96. #endif
  97. }
  98. #endif /* L_vs_clip */
  99.  
  100. /* -eof- */
  101.